package com.aaa.controller;

import com.aaa.entity.Class;
import com.aaa.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/class")
public class ClassController {
    @Autowired
    private ClassService classService;
    //查询所有班级
    @RequestMapping("/list")
    @ResponseBody//返回json格式数据
    public List<Class> list(){
        return classService.getAllClass();
    }
}
